import $http from '@/utils/request.js'

// region 页面----------------------------------

// 区域列表
export const aListOfRegions = (params) => {
  return $http({
    url: '/api/vm-service/region/search',
    params
  })
}
// 新增区域
export const addANewRegionAPI = (data) => {
  return $http({
    url: '/api/vm-service/region',
    method: 'POST',
    data
  })
}
// 点位搜索
export const pointSearchAPI = (params) => {
  return $http({
    url: '/api/vm-service/node/search',
    params
  })
}
// 修改区域
export const modifyTheRegionAPI = ({ id, regionName, remark }) => {
  return $http({
    url: `/api/vm-service/region/${id}`,
    method: 'PUT',
    data: {
      id,
      regionName,
      remark
    }
  })
}
// 删除区域
export const deleteAZone = (id) => {
  return $http({
    url: `/api/vm-service/region/${id}`,
    method: 'DELETE'
  })
}
// node 页面----------------------------------

// 点位搜索
export const PointSearchAPI = (params) => {
  return $http({
    url: '/api/vm-service/node/search',
    params
  })
}

// 点位详情
export const pointDetailsAPI = (id) => {
  return $http({
    url: `/api/vm-service/node/vmList/${id}`
  })
}
// 商圈列表
export const listOfBusinessDistrictsAPI = () => {
  return $http({
    url: '/api/vm-service/businessType'
  })
}
// 合作商搜索
export const partnersAPI = () => {
  return $http({
    url: '/api/user-service/partner/search',
    params: {
      pageIndex: 1,
      pageSize: 100000
    }
  })
}
// 修改点位
export const modifyThePointAPI = (data, id) => {
  return $http({
    url: `/api/vm-service/node/${id}`,
    method: 'PUT',
    data
  })
}

// 删除点位
export const deleteAPoint = (id) => {
  return $http({
    url: `/api/vm-service/node/${id}`,
    method: 'DELETE'
  })
}
// 新增点位
export const newPointsAddedAPI = (data) => {
  return $http({
    url: '/api/vm-service/node',
    method: 'POST',
    data
  })
}
// 合作商页面-----------------------

// 合作商搜索
export const partnerSearchAPI = (params) => {
  return $http({
    url: '/api/user-service/partner/search',
    params
  })
}
// 新增合作商
export const newPartnersAPI = (data) => {
  return $http({
    url: '/api/user-service/partner',
    method: 'POST',
    data
  })
}
// 重置合作商密码
export const resetThePartnerPasswordAPI = (id) => {
  return $http({
    url: `/api/user-service/partner/resetPwd/${id}`,
    method: 'PUT'
  })
}
// 修改合作商
export const modifyPartnersAPI = (data, id) => {
  return $http({
    url: `api/user-service/partner/${id}`,
    method: 'PUT',
    data
  })
}
// 删除合作商
export const deleteAPartnerAPI = (id) => {
  return $http({
    url: `/api/user-service/partner/${id}`,
    method: 'DELETE'
  })
}

